package com.heima.user.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.LoginDto;
import com.heima.user.service.ApUserService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @RestController = @ResponseBody + @Controller
 */
@RequestMapping("/api/v1/login")
@RestController
public class UserController {

    @Autowired
    private ApUserService apUserService;

    /**
     * @RequestBody 前端JSON传参
     * @RequestParm 普通传参
     * @PathVariable  请求URL传参
     * @param dto
     * @return
     */
    @PostMapping("/login_auth")
    public ResponseResult login(@RequestBody LoginDto dto){
        return apUserService.login(dto);
    }

    @GetMapping("/test")
    public void test(){

    }
}
